require "import"
import "tools"
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS).setStatusBarColor(0xff4DB6AC)
activity.setContentView("pDrawWave_")
oDir.text=LUA_SD.."/avHandle/output/"
iDir.onClick=function()
  ChoiceFile(LUA_SD,function(dir)
    iDir.text=dir
  end)
end
oDir.onClick=function()
  ChoicePath(LUA_SD,function(dir)
    oDir.text=dir.."/"
  end)
end
draw.background=btBackground
draw. onClick=function()
  if File(iDir.text).exists()
    if filename.text~="" and bg.text~="" and fg.text~="" and size.text~=""
      local cmd="-i "..iDir.text.." -lavfi color="..bg.text..":s="..size.text.."[bg],[0]showwavespic=s="..size.text..":colors="..fg.text.."[t1],[bg][t1]overlay -vframes 1 -y "..oDir.text..filename.text..".png"
      activity.newActivity("handle",{cmd})
     else
      print("请填写完整")
    end
   else
    print("所选文件不存在")
  end
end